I2C to Grove bridge
General
HW: any uC e.g. ATTINY with custom PCB
SW: C++
Idea
- connect Grove sensors and standard "analoge" sensors to I2C
- common interface for various sensors
- enable bigger projects e.g. RoboCar
Details
HW interface
- pinout: compatible to Qwiic/Stemma plus interrupt line
- connector: cheap and easy, e.g. 10 line ribbon cable with crimp connector
- housing compatible with Lego Technics
Memory Map
8 pages with 32 bytes each
| page | function |
|---|---|
| 0 | read/write Pin A |
| 1 | parameters Pin A |
| 2 | read/write Pin B |
| 3 | parameters Pin B |
| 4 | empty |
| 5 | setup INT line |
| 6 | setup LED behaviour |
| 7 | setup device, e.g. I2C adress |
| ## Modes | |
| - digital (static) => no parameter | |
| - digital (single shot, monostable) => duration | |
| - digital (blinking, astable) => low-time, high-time | |
| - digital (PWM) => frequency, duty cycle |
- analog (static) => none
- analog (measurement, limited) => time between readings, number of readings
-
analog (monitoring, continues measurement) => time between readings
-
specific (ultrasonic sensor) => none
- specific (temp/hum sensor DHT11) => none
- specific (servo) => fixed frequency, calculate dutycycle from percentage
Interrupt
- digital:
- static: when high
- static: when low
- monostable: when pulse ends
- astable: tbd
- PWM: none
- ultrasonic: when result is ready
- analog
- when threshold is exceeded
- when threshold is deceeded
LED
- during communication
- when active (e.g. static high)